import 'package:flutter/material.dart';
import 'package:niuren_demo/configs/Colors_util.dart';
import 'package:niuren_demo/model/NrAccountItem_model.dart';
import 'package:niuren_demo/view/text/text_style.dart';

class NrAccountItem extends StatelessWidget {
  final NrAccountItem_Model dataModel;

  const NrAccountItem({Key key, this.dataModel}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.all(5),
      padding: EdgeInsets.fromLTRB(15, 8, 0, 5),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(5),
        boxShadow: [
          BoxShadow(
              color: Colors.black12,
              offset: Offset(0.0, 15.0),
              blurRadius: 15.0,
              spreadRadius: 1.0,
          )
        ]
      ),
      child: Column(
        children: [
          Row(
            children: [
              Container(
                width: 30,
                height: 30,
                decoration: BoxDecoration(
                  image: DecorationImage(
                    image: NetworkImage("${dataModel.imageurl}"),
                  ),
                ),
              ),
              SizedBox(width: 5,),
              Text_style(
                data: "${dataModel.title}",
                fontSize: 17,
              )
            ],
          ),
          SizedBox(height: 4,),
          Text_style(
            data: "${dataModel.tip}",
            fontSize: 12,
            color: Colors.grey,
          ),
          SizedBox(height: 16,),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: [
              Container(
                  child: Column(
                    children: [
                      Text_style(
                        data: "${dataModel.followInt}",
                        color: ColorsUtil.hexColor(0x00E48E),
                        fontSize: 18,
                      ),
                      Text_style(
                        data: "跟随",
                        color: Colors.grey,
                        fontSize: 13,
                      ),
                    ],
                  ),
              ),
              Container(
                child: Column(
                  children: [
                    Text_style(
                      data: "${dataModel.profit}%",
                      color: ColorsUtil.hexColor(0x00E48E),
                      fontSize: 18,
                    ),
                    Text_style(
                      data: "盈利",
                      color: Colors.grey,
                      fontSize: 13,
                    ),
                  ],
                ),
              ),
            ],
          )
        ],
      ),
    );
  }
}
